package com.zyf.springcloud.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zyf.springcloud.dao.RoleDao;
import com.zyf.springcloud.model.Role;
import com.zyf.springcloud.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class RoleServiceImpl extends ServiceImpl<RoleDao, Role> implements RoleService {
    @Autowired
    RoleDao roleDao;
    public List selectRoleNameByRoleId(List<Integer> list){
        QueryWrapper queryWrapper=new QueryWrapper();
        for (Integer integer:list){
            queryWrapper.eq("id",integer);
        }
        List<Role> list1 = roleDao.selectList(queryWrapper);
        List<String> list2=new ArrayList<>();
        for (Role role:list1){
            list2.add(role.getName());
        }
        return list2;
    }
}
